
const conn = require("./db/mongoose");
const mongoose = conn.mongo;

const Schema = mongoose.Schema;

const ClubSchema = new Schema({
    bossid :{type:Number},   //创建者
    clubId : {type:Number, default:0}, //俱乐部Id
    conf : {},   //房间配置信息
    configs:{type:Array, default:[]}, //桌子配置信息
    name : {type:String, default :""},
    tablesid : [],
    games:{type:Number, default:0},
    createAt :{type:Number, default:parseInt(Date.now()/1000)},
    state : {type:Number, default:0},  //0未打烊，1已经打烊
    notice :String, //跑马灯内容
    rank_state:{type:Number, default:0}, //0，所有人都可以看，1，只有圈主和管理员可以看
});


ClubSchema.index({clubId:1,unique: true});

const ClubModel = mongoose.model("club",ClubSchema);

module.exports = ClubModel;